package renshi.db.service;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateHelper {

	public static String PATTERN_yyyy_MM_dd = "yyyy-MM-dd";
	public static String PATTERN_yyyyMMddHHmmss = "yyyyMMddHHmmss";
	public static String PATTERN_yyyy_MM_dd_HHmmss = "yyyy-MM-dd HH:mm:ss";
	public static String PATTERN_yyyyMMdd = "yyyyMMdd";
	public static String PATTERN_yyyyMMddHHmmssSSS = "yyyyMMddHHmmssSSS";
	
	public static String parseDateToString(Date date, String pattern) {
		if (date == null) {
			return "";
		}
		SimpleDateFormat _df = new SimpleDateFormat(pattern);
		return _df.format(date);
	}
	
}
